#include "beepvalidator.h"
#include <QApplication>

BeepValidator::BeepValidator(int bottom, int top, QObject * parent): QIntValidator(parent)
{
 setRange(bottom, top);
}

BeepValidator::~BeepValidator()
{
}

QIntValidator::State BeepValidator::validate(QString & input, int &) const
{/*
 QString stripped = input;
 if (stripped.isEmpty())
 {
  return Intermediate;
 }
 bool ok = true;
 long entered = input.toLong(&ok);
 if (!ok || (entered < 0 && bottom >= 0))
 {
  return Invalid;
  QApplication::beep();
 }
 else if (entered >= bottom && entered <= top)
 {
  return Acceptable;
 }
 else
 {
  if (entered >= 0)
  {
   return (entered > top) ? Invalid : Intermediate;
  }
  else
   return (entered < bottom) ? Invalid : Intermediate;
 }*/
}
